<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="my" uri="/mytags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="/admin/jsp/common/HtmlHead.jsp"/>
<title>Insert title here</title>
<script type="text/javascript">
function onsearch(){
	var txt = document.getElementById('title');
	if(txt.value==''){
		alert('请输入查询条件');
		return;
	}
	document.getElementById('btn_search').click();
}
</script>
</head>
<body>
	<div id="page_main">
		<div class="top_bar">
			<span class="sta_pos">当前位置：</span><span>新闻管理</span>
			&gt;
			<span>新闻列表</span>
		</div>
		<div class="tool_bar">
			<div class="bar_ctn">
			<s:form>
				<table width="100%" border="0" class="list_tab" cellpadding="0" cellspacing="0">
					<tr>
						<td>
							新闻标题：<s:textfield name="news.title" cssClass="txt" id="title" style="margin-right:6px;"/>
						</td>
						<td>
							<a class="btn" href="javascript:onsearch()"><span>查询</span></a>
							<input type="submit" value="查询" id="btn_search" style="display:none;"/>
						</td>
					</tr>
				</table>
			</s:form>
			</div>
			<s:a action="edit" cssClass="btn" style="float:right;margin-right:12px;"><span>添加</span></s:a>
		</div>
	<div class="con_list">
	<table width="100%" border="0" class="list_tab" cellpadding="0" cellspacing="0">
		<tr>
			<th>新闻标题</th>
			<th style="width:130px;">创建时间</th>
			<th style="width:100px;">创建人</th>
			<th style="width:80px;">浏览次数</th>
			<th style="width:40px;">置顶</th>
			<th style="width:80px;">操作</th>
		</tr>
		<s:iterator value="newsList">
		<tr>
			<td class="txt_lft">
				<my:justify value="title" maxlength="50"/>
			</td>
			<td>
				<s:date name="createTime" format="yyyy-MM-dd HH:mm"/>
			</td>
			<td>
				<s:property value="creatorName"/>
			</td>
			<td>
				<s:property value="clicks"/>
			</td>
			<td>
				<s:a action="sticky">
					<s:param name="news.id" value="id"></s:param>
					<s:param name="news.sticky" value="sticky"></s:param>
					<s:property value="%{getI18nValue('system.whether',sticky)}"/>
				</s:a>
			</td>
			<td class="last">
				<s:a action="edit">
					<s:param name="news.id" value="id"/>
					编辑
				</s:a>
				|
				<s:url id="delUrl" action="delete">
					<s:param name="news.id" value="id"/>
				</s:url>
				<a href="javascript:deleteConfirm('<s:property value="#delUrl"/>')">
					删除
				</a>
			</td>
		</tr>
		</s:iterator>
	</table>
	</div>
	<div class="page_ctn">
		<my:pagination totalPageCount="pageBean.totalPageCount" totalRecordCount="pageBean.totalRecordCount"
			pageNo="pageBean.pageNo" theme="number">
			<s:param name="news.title" value="@java.net.URLEncoder@encode(news.title,'utf-8')"/>
		</my:pagination>
	</div>
	</div>
</body>
<jsp:include page="/admin/jsp/common/errorMessage.jsp"/>
</html>